<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>  </title>
    <style>
        *{
            margin: 0;
        }

        .parent{
            width: 500px;
            height: 500px;
            border: 1px solid red;
            margin: 0 auto;
            position: relative;
        }
        .box{
            width: 300px;
            height: 300px;
            border: 1px solid red;
           
            
        }
        .box div{
            width: 100px;
            height: 100px;
        }

        .box .child1{
            background-color: deepskyblue;
            position: absolute;
            left: 50px;
            top: 50px;
        }

        .box .child2{
            background-color: green;
        }
    </style>
</head>
<body>
    <div class="parent">
    <div class="box">
        <div class="child1"></div>
        <div class="child2"></div>
    </div>
</div>
</body>
</html>